use "PATH(zip_RESTS_CBB_PPP_gini_CBP_County_Full_210114_dummies.dta)", clear
encode size, generate(sizeFE)
encode stateabbrev, generate(stateFE)
generate log_parent_size = ln(parent_location_count)
generate log_brand_size = ln(revised_brand_count)

label var FS_count_loans_P1_per_est "% Food service est. w/ PPP (Phase 1)"
label var FS_count_loans_P1P2_per_est "% Food service est. w/ PPP (Both Phases)"
label var FS_count_PCT_P1 "% of all PPP loans received in Phase 1"
label var FS_count_loans_P1_per_est_COUNTY "% Food service est. w/ PPP (Phase 1)"
label var FS_count_loans_P1P2_per_est_COUN "% Food service est. w/ PPP (Both Phases)"
label var FS_count_PCT_P1_COUNTY "% of all PPP loans received in Phase 1"
label var PCT_male "% Male"
label var PCT_18_years_and_over_ "% Age >= 18"
label var PCT_Asian "% Asian"
label var PCT_Hispanic__of_any_race_ "% Hispanic"
label var PCT_Bachelor_s_degree_or_higher "% w/ Bachelor's or higher"
label var Average_household_size "Avg. household size"
label var PCT_in_poverty "% in poverty"
label var PCT_employed "% Employed"
label var PCT_disabled "% Disabled"
label var PCT_with_health_coverage "% w/ health coverage"
label var PCT_workers_using_public_transpo "% workers using public trans."
label var Perc_dining_out "% of household exp. dining out"
label var Rating "Rest. Yelp rating"
label var log_age "Log rest. age"
label var log_Reviews "Log rest. reviews"
label var log_Total_population "Log ZIP code population"
label var log_Median_age "Log median age"
label var log_Median_household_income "Log median household income"
label var log_Total_number_of_housing_unit "Log # housing units"
label var log_Median_owner_occupied_housin "Log median home value"
label var log_Median_rent__housing_ "Log median rent"
label var affinity_spend_all "TtR Affinity Spending"
label var case_rate "TtR COVID case rate"
label var death_rate "TtR COVID death rate"
label var emp_combined "TtR employment change"
label var gps_retail_and_recreation "TtR mobility - retail & rec."
label var initclaims_rate_regular "TtR UI claim change"
label var merchants_all "TtR merchants open"
label var revenue_all "TtR merchants revenue"
label var pct_rep_16 "% Republican 2016"
label var vote_pct_16 "% Voted 2016"
label var Homeownership_rate "Homeownership rate"
label var Vacancy_rate "Vacancy rate"
label var PCT_with_a_broadband_internet_su "% with broadband"
label var gini "Income inequality - Gini"
label var PCT_Black_or_African_American "% African American"
eststo clear

local food_types Gastropubs_dummy Hot_Dogs_dummy Gluten_Free_dummy Breakfast___Brunch_dummy Mexican_dummy American_New_dummy Barbeque_dummy Music_Venues_dummy Beer_Bar_dummy Restaurants_dummy Food_Stands_dummy Mediterranean_dummy Hawaiian_dummy Lounges_dummy Seafood_dummy Food_Trucks_dummy Fast_Food_dummy Southern_dummy Vietnamese_dummy Soup_dummy Soul_Food_dummy Cocktail_Bars_dummy Ramen_dummy Comfort_Food_dummy French_dummy Japanese_dummy Sports_Bars_dummy Cheesesteaks_dummy Salad_dummy Grocery_dummy Bakeries_dummy Greek_dummy Korean_dummy Latin_American_dummy Tacos_dummy Vegetarian_dummy Vegan_dummy Middle_Eastern_dummy Pizza_dummy Convenience_Stores_dummy Tex_Mex_dummy Desserts_dummy Bagels_dummy Asian_Fusion_dummy Cafes_dummy Burgers_dummy Wine___Spirits_dummy Ice_Cream___Frozen_Yogurt_dummy Cuban_dummy Chinese_dummy Sushi_Bars_dummy Caribbean_dummy Juice_Bars___Smoothies_dummy Bars_dummy Chicken_Shop_dummy Chicken_Wings_dummy Venues___Event_Spaces_dummy Delis_dummy Indian_dummy Sandwiches_dummy Beer_dummy Noodles_dummy Pubs_dummy Halal_dummy Coffee___Tea_dummy Wraps_dummy Gas_Stations_dummy Wine_Bars_dummy Cajun_Creole_dummy Diners_dummy American_Traditional_dummy Italian_dummy Caterers_dummy Thai_dummy Steakhouses_dummy Buffets_dummy Tapas_Small_Plates_dummy

local food_types_2 American_Traditional_dummy Mexican_dummy Seafood_dummy Italian_dummy American_New_dummy Chinese_dummy Barbeque_dummy Sushi_Bars_dummy Japanese_dummy Sports_Bars_dummy

local food_types_3 Fast_Food_dummy Gastropubs_dummy Cocktail_Bars_dummy Sports_Bars_dummy Cafes_dummy Pubs_dummy Coffee___Tea_dummy Wine_Bars_dummy Venues___Event_Spaces_dummy Beer_Bar_dummy Food_Stands_dummy Lounges_dummy Food_Trucks_dummy Bars_dummy Diners_dummy Steakhouses_dummy

local food_types_3_no_FF Gastropubs_dummy Cocktail_Bars_dummy Sports_Bars_dummy Cafes_dummy Pubs_dummy Coffee___Tea_dummy Wine_Bars_dummy Venues___Event_Spaces_dummy Beer_Bar_dummy Food_Stands_dummy Lounges_dummy Food_Trucks_dummy Bars_dummy Diners_dummy Steakhouses_dummy

* PPP Effects Phase 1 x Bayesian Rating
ivreghdfe Closed (FS_count_loans_P1_per_est c.FS_count_loans_P1_per_est#c.bayes_rating = c.bayes_rating#c.CB_Share_zip CB_Share_zip) ///
drive_thru Public_Firm PCT_male PCT_18_years_and_over_ PCT_Asian ///
PCT_Hispanic__of_any_race_ PCT_Bachelor_s_degree_or_higher Average_household_size PCT_in_poverty ///
PCT_employed PCT_disabled PCT_with_health_coverage PCT_workers_using_public_transpo ///
Homeownership_rate Vacancy_rate PCT_with_a_broadband_internet_su gini PCT_Black_or_African_American ///
Perc_dining_out bayes_rating Rating log_age log_Reviews log_Total_population log_Median_age log_Median_household_income ///
log_Total_number_of_housing_unit log_Median_owner_occupied_housin log_Median_rent__housing_ c.log_brand_size ///
`food_types_3' ///
[aw = food_service_est_y], baselevels ///
absorb(county, savefe) cluster(zip) first

* PPP Effects Phase 1 or 2 x Bayesian Rating
ivreghdfe Closed (FS_count_loans_P1P2_per_est c.FS_count_loans_P1P2_per_est#c.bayes_rating = c.bayes_rating#c.CB_Share_zip CB_Share_zip) ///
drive_thru Public_Firm PCT_male PCT_18_years_and_over_ PCT_Asian ///
PCT_Hispanic__of_any_race_ PCT_Bachelor_s_degree_or_higher Average_household_size PCT_in_poverty ///
PCT_employed PCT_disabled PCT_with_health_coverage PCT_workers_using_public_transpo ///
Homeownership_rate Vacancy_rate PCT_with_a_broadband_internet_su gini PCT_Black_or_African_American ///
Perc_dining_out bayes_rating Rating log_age log_Reviews log_Total_population log_Median_age log_Median_household_income ///
log_Total_number_of_housing_unit log_Median_owner_occupied_housin log_Median_rent__housing_ c.log_brand_size ///
`food_types_3' ///
[aw = food_service_est_y], baselevels ///
absorb(county, savefe) cluster(zip) first

* PPP Effects Phase 1 Percent x Bayesian Rating
ivreghdfe Closed (FS_count_PCT_P1 c.FS_count_PCT_P1#c.bayes_rating = c.bayes_rating#c.CB_Share_zip CB_Share_zip) ///
drive_thru Public_Firm PCT_male PCT_18_years_and_over_ PCT_Asian ///
PCT_Hispanic__of_any_race_ PCT_Bachelor_s_degree_or_higher Average_household_size PCT_in_poverty ///
PCT_employed PCT_disabled PCT_with_health_coverage PCT_workers_using_public_transpo ///
Homeownership_rate Vacancy_rate PCT_with_a_broadband_internet_su gini PCT_Black_or_African_American ///
Perc_dining_out bayes_rating Rating log_age log_Reviews log_Total_population log_Median_age log_Median_household_income ///
log_Total_number_of_housing_unit log_Median_owner_occupied_housin log_Median_rent__housing_ c.log_brand_size ///
`food_types_3' ///
[aw = food_service_est_y], baselevels ///
absorb(county, savefe) cluster(zip) first

* PPP Effects Phase 1 x Log Reviews
ivreghdfe Closed (FS_count_loans_P1_per_est c.FS_count_loans_P1_per_est#c.log_Reviews = c.log_Reviews#c.CB_Share_zip CB_Share_zip) ///
drive_thru Public_Firm PCT_male PCT_18_years_and_over_ PCT_Asian ///
PCT_Hispanic__of_any_race_ PCT_Bachelor_s_degree_or_higher Average_household_size PCT_in_poverty ///
PCT_employed PCT_disabled PCT_with_health_coverage PCT_workers_using_public_transpo ///
Homeownership_rate Vacancy_rate PCT_with_a_broadband_internet_su gini PCT_Black_or_African_American ///
Perc_dining_out bayes_rating Rating log_age log_Reviews log_Total_population log_Median_age log_Median_household_income ///
log_Total_number_of_housing_unit log_Median_owner_occupied_housin log_Median_rent__housing_ c.log_brand_size ///
`food_types_3' ///
[aw = food_service_est_y], baselevels ///
absorb(county, savefe) cluster(zip) first

* PPP Effects Phase 1 or 2 x Log Reviews
ivreghdfe Closed (FS_count_loans_P1P2_per_est c.FS_count_loans_P1P2_per_est#c.log_Reviews = c.log_Reviews#c.CB_Share_zip CB_Share_zip) ///
drive_thru Public_Firm PCT_male PCT_18_years_and_over_ PCT_Asian ///
PCT_Hispanic__of_any_race_ PCT_Bachelor_s_degree_or_higher Average_household_size PCT_in_poverty ///
PCT_employed PCT_disabled PCT_with_health_coverage PCT_workers_using_public_transpo ///
Homeownership_rate Vacancy_rate PCT_with_a_broadband_internet_su gini PCT_Black_or_African_American ///
Perc_dining_out bayes_rating Rating log_age log_Reviews log_Total_population log_Median_age log_Median_household_income ///
log_Total_number_of_housing_unit log_Median_owner_occupied_housin log_Median_rent__housing_ c.log_brand_size ///
`food_types_3' ///
[aw = food_service_est_y], baselevels ///
absorb(county, savefe) cluster(zip) first

* PPP Effects Phase 1 Percent x Log Reviews
ivreghdfe Closed (FS_count_PCT_P1 c.FS_count_PCT_P1#c.log_Reviews = c.log_Reviews#c.CB_Share_zip CB_Share_zip) ///
drive_thru Public_Firm PCT_male PCT_18_years_and_over_ PCT_Asian ///
PCT_Hispanic__of_any_race_ PCT_Bachelor_s_degree_or_higher Average_household_size PCT_in_poverty ///
PCT_employed PCT_disabled PCT_with_health_coverage PCT_workers_using_public_transpo ///
Homeownership_rate Vacancy_rate PCT_with_a_broadband_internet_su gini PCT_Black_or_African_American ///
Perc_dining_out bayes_rating Rating log_age log_Reviews log_Total_population log_Median_age log_Median_household_income ///
log_Total_number_of_housing_unit log_Median_owner_occupied_housin log_Median_rent__housing_ c.log_brand_size ///
`food_types_3' ///
[aw = food_service_est_y], baselevels ///
absorb(county, savefe) cluster(zip) first